package com.foosun.core.entity;

import com.alibaba.fastjson.JSONObject;
import com.foosun.core.base.BaseEntity;
import com.foosun.core.util.JDBCName;

import java.util.Map;
import java.util.Set;

/**
 * Created by Nelin on 14-5-30.
 */
@JDBCName("C_ROLE")
public class Role extends BaseEntity {

    private String name; //资源名称
    private String code;//角色编码
    private String memo;//备注
    private Boolean enable;//禁用
    private String scope;

    private JSONObject scopeData;
    private Set<Resource> resources;

    @Override
    public Map<String, Object> getEntityMap() {
        Map<String, Object> map = super.getEntityMap();
        map.put("name", name);
        map.put("memo", memo);
        map.put("code", code);
        map.put("enable", enable);
        map.put("scope", scope);
        return map;
    }

    public Set<Resource> getResources() {
        return resources;
    }

    public void setResources(Set<Resource> resources) {
        this.resources = resources;
    }

    public JSONObject getScopeData() {
        return scopeData;
    }

    public void setScopeData(JSONObject scopeData) {
        this.scopeData = scopeData;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }
}
